<%@page import="dashboard.UserRegistry"%>
<%@ page contentType="text/html;charset=UTF-8" language="java"%>
<%@ page import="java.util.List"%>
<%@ page import="com.google.appengine.api.users.UserService"%>
<%@ page import="com.google.appengine.api.users.UserServiceFactory"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ page import="dashboard.User"%>

<html>
<head>
<link type="text/css" rel="stylesheet" href="/stylesheets/main.css" />
</head>

<body>
	<div id="main">
		<%@include file="header.jsp"%>
		<%if(session.getAttribute("userName")==null){
					if (request.getParameter("l") != null) {
						if (request.getParameter("l").equals("false")) {
							
					session.setAttribute("warning", "You have inserted wrong information, please fix the problems.");
					}
					}
				%>
		<%@include file="message.jsp"%>
		<form action="Login" method="post" style="font-size: 25px;">
			<fieldset>
				<legend>Login</legend>
				Welcome to Dashboard! <br><font size="2">Don't now what this is? <a href="info.jsp">Read a short intro :) !</a> <br>Or <a href="register.jsp">Register</a> now if you don't have an
				account yet.</font><br>
				<%
					if ((String) session.getAttribute("username") != null) {
						response.sendRedirect("dashboard.jsp?l=ag");
					}
				%>
				<br /> Username: <br /> <input  style='width: 100%; height: 35px; font-size: 25px;' type="text"
					name="username" 
					value="<%if (session.getAttribute("Lusername") != null)%><%=session.getAttribute("Lusername")%>" /><br />
				Password: <br /> <input  style='width: 100%; height: 35px; font-size: 25px;' type="password"
					name="password" /> <br /> <br /> <br />
								<div class="button">
									<input type="submit" value="Submit"  style='width: 95%;'/>
								</div>
				<br /> <br /> <a href="forgotpassword.jsp">Click here</a> if you
				forgot your password.
			</fieldset>
		</form>
	</div>
	<%}
		else{
		response.sendRedirect("dashboard.jsp"); }%>
</body>
</html>